﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NoticeInfo.aspx.cs" Inherits="EDMS.Admin.Notice.NoticeInfo"
    MasterPageFile="~/MainMaster.master" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script language="javascript" type="text/javascript">
        function OnGridFocusedRowChanged() {
            gvNotice.GetRowValues(gvNotice.GetFocusedRowIndex(), 'ggbt;nr;fbr;fbsj;ggbh;xjbh', OnGetRowValues);
        }

        function OnGetRowValues(values) {
            ggbt.SetText(values[0]);
            ggnr.SetText(values[1]);
            fbr.SetText(values[2]);
            //            fbsj.SetValue(values[3]);
            txtBh.SetText(values[4]);
            //            xjbh.SetText(values[5]);
            //xjbhx.SetText(values[5])
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="MainContent">
    <h1 class="DemoTitle">
        选举公告管理
    </h1>
    <div id="DemoArea">
        <div class="Spacer" style="height: 14px;">
        </div>
    </div>
    <dx:ASPxCallbackPanel ID="CBPanel" ClientInstanceName="QueryPanel" runat="server"
        Width="100%" OnCallback="CBPanel_Callback">
        <PanelCollection>
            <dx:PanelContent>
                <%--                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            公告标题：
                        </td>
                        <td>
                            <dx:ASPxTextBox ID="txtGgbtc" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            发布人：
                        </td>
                        <td>
                            <dx:ASPxTextBox ID="txtFbrc" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            发布时间：
                        </td>
                        <td>
                            <dx:ASPxDateEdit ID="deFbsjc" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                <CalendarProperties>
                                    <HeaderStyle Spacing="1px" />
                                </CalendarProperties>
                            </dx:ASPxDateEdit>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnCx" runat="server" Text="查询" AutoPostBack="False" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                <ClientSideEvents Click="function(s,e){QueryPanel.PerformCallback();}"></ClientSideEvents>
                            </dx:ASPxButton>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnQk" runat="server" Text="清空检索条件" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                OnClick="btnQk_Click" AutoPostBack="false">
                            </dx:ASPxButton>
                        </td>
                    </tr>--%>
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            选举编号：
                        </td>
                        <td align="left">
                            <dx:ASPxTextBox ID="txtXjbhs" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                ReadOnly="True">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            选举名称：
                        </td>
                        <td>
                            <dx:ASPxTextBox ID="txtXjmcs" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                ReadOnly="True">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            选举时间：
                        </td>
                        <td>
                            <dx:ASPxTextBox ID="txtXjsjs" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                ReadOnly="True">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            <td>
                                <dx:ASPxButton ID="btnCx" runat="server" Text="查询" AutoPostBack="False" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                    <ClientSideEvents Click="function(s,e){QueryPanel.PerformCallback();}"></ClientSideEvents>
                                </dx:ASPxButton>
                            </td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <dx:ASPxButton ID="btnAdd" runat="server" Text="添加选举公告" AutoPostBack="false" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                <ClientSideEvents Click="function(s, e) { pcAddNotice.Show(); }" />
                            </dx:ASPxButton>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnEdit" runat="server" Text="修改选举公告" AutoPostBack="false" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                OnClick="btnEdit_Click">
                                <ClientSideEvents Click="function(s, e) { pcUpdateNotice.Show(); }" />
                            </dx:ASPxButton>
                        </td>
                        <td colspan="5">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="7">
                            <dx:ASPxGridView ID="gvNotice" runat="server" Width="98%" AutoGenerateColumns="False"
                                ClientInstanceName="gvNotice" KeyFieldName="ggbh" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" DataSourceID="LDSXjgg">
                                <SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" ProcessSelectionChangedOnServer="True" />
                                <ClientSideEvents FocusedRowChanged="function(s, e) { OnGridFocusedRowChanged(); }" />
                                <Columns>
                                    <dx:GridViewDataTextColumn Caption="公告标题" FieldName="ggbt" VisibleIndex="0">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="公告内容" FieldName="nr" VisibleIndex="1">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="发布人" FieldName="fbr" VisibleIndex="2">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="发布时间" FieldName="fbsj" VisibleIndex="3">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="操作" VisibleIndex="7">
                                        <DataItemTemplate>
                                            <%-- <a href='UpdateNotice.aspx?GID=<%#Eval("ggbh") %>'>编辑</a>--%>
                                            <asp:LinkButton ID="btnDelete" runat="server" CommandArgument='<%#Eval("ggbh") %>'
                                                OnClientClick="return confirm('确定要删除吗？');" OnClick="btnDelete_Click">删除</asp:LinkButton>
                                        </DataItemTemplate>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                                <SettingsPager Visible="False">
                                </SettingsPager>
                                <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                    <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                    </LoadingPanelOnStatusBar>
                                    <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                    </LoadingPanel>
                                </Images>
                                <ImagesFilterControl>
                                    <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                    </LoadingPanel>
                                </ImagesFilterControl>
                                <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                                    <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                    </Header>
                                    <LoadingPanel ImageSpacing="5px">
                                    </LoadingPanel>
                                </Styles>
                                <StylesPager>
                                    <PageNumber ForeColor="#3E4846">
                                    </PageNumber>
                                    <Summary ForeColor="#1E395B">
                                    </Summary>
                                </StylesPager>
                                <StylesEditors ButtonEditCellSpacing="0">
                                    <ProgressBar Height="21px">
                                    </ProgressBar>
                                </StylesEditors>
                            </dx:ASPxGridView>
                        </td>
                    </tr>
                </table>
            </dx:PanelContent>
        </PanelCollection>
    </dx:ASPxCallbackPanel>
    <!--新增-->
    <dx:ASPxPopupControl ID="pcAddNotice" runat="server" CloseAction="CloseButton" Modal="True"
        PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" ClientInstanceName="pcAddNotice"
        HeaderText="添加选举公告信息" AllowDragging="True" EnableAnimation="False" EnableHotTrack="False"
        EnableViewState="False" Width="450px" Height="350px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
        CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
        OnLoad="pcAddNotice_Load">
        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
        </LoadingPanelImage>
        <LoadingPanelStyle ImageSpacing="5px">
        </LoadingPanelStyle>
        <ContentCollection>
            <dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server">
                <dx:ASPxPanel ID="Panel1" runat="server" DefaultButton="btnOK" Width="450px" Height="350px">
                    <PanelCollection>
                        <dx:PanelContent ID="PanelContent1" runat="server" Width="450px" Height="350px">
                            <table cellspacing="10px" cellpadding="0" border="0" style="width: 100%">
                                <tr>
                                    <td height="25" width="40%" align="right">
                                        选举编号：
                                    </td>
                                    <td>
                                        <dx:ASPxTextBox ID="txtXjbh" ReadOnly="true" ClientInstanceName="xjbh" runat="server"
                                            Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                        </dx:ASPxTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" width="40%" align="right">
                                        公告标题：
                                    </td>
                                    <td>
                                        <dx:ASPxTextBox ID="txtGgbt" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                        </dx:ASPxTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" width="40%" align="right">
                                        公告内容：
                                    </td>
                                    <td>
                                        <dx:ASPxMemo ID="txtGgnr" runat="server" Height="140px" Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                        </dx:ASPxMemo>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" width="40%" align="right">
                                        发布人：
                                    </td>
                                    <td>
                                        <dx:ASPxTextBox ID="txtFbr" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                        </dx:ASPxTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" width="40%" align="right">
                                        发布时间：
                                    </td>
                                    <td>
                                        <%--<dx:ASPxDateEdit ID="deFbsj" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                            <CalendarProperties>
                                                <HeaderStyle Spacing="1px" />
                                            </CalendarProperties>
                                        </dx:ASPxDateEdit>--%>
                                        <dx:ASPxTextBox ID="txtFbsj" ReadOnly="true" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                        </dx:ASPxTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <dx:ASPxButton ID="btnOK" runat="server" Text="新增" OnClick="btnOK_Click" Width="60px"
                                            CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                            <ClientSideEvents Click="function(s, e) { pcAddNotice.Hide(); }" />
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="btnEsc" runat="server" Text="重置" OnClick="btnEsc_Click" Width="60px"
                                            Style="height: 25px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                            <ClientSideEvents Click="function(s, e) { pcAddNotice.Hide(); }" />
                                        </dx:ASPxButton>
                                    </td>
                                </tr>
                            </table>
                        </dx:PanelContent>
                    </PanelCollection>
                </dx:ASPxPanel>
            </dx:PopupControlContentControl>
        </ContentCollection>
    </dx:ASPxPopupControl>
    <!--修改-->
    <dx:ASPxPopupControl ID="pcUpdateNotice" runat="server" CloseAction="CloseButton"
        Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
        ClientInstanceName="pcUpdateNotice" HeaderText="修改选举公告信息" AllowDragging="True"
        EnableAnimation="False" EnableHotTrack="False" EnableViewState="False" Width="450px"
        Height="350px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" OnLoad="pcUpdateNotice_Load">
        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
        </LoadingPanelImage>
        <LoadingPanelStyle ImageSpacing="5px">
        </LoadingPanelStyle>
        <ContentCollection>
            <dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server">
                <dx:ASPxPanel ID="ASPxPanel1" runat="server" DefaultButton="btnOK" Width="450px"
                    Height="350px">
                    <PanelCollection>
                        <dx:PanelContent ID="PanelContent2" runat="server" Width="450px" Height="350px">
                            <table cellspacing="10px" cellpadding="0" border="0" style="width: 100%">
                                <tr>
                                    <td height="25" width="40%" align="right">
                                        选举编号：
                                    </td>
                                    <td>
                                        <dx:ASPxTextBox ID="txtXjbhx" ReadOnly="true" ClientInstanceName="xjbhx" runat="server"
                                            Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                        </dx:ASPxTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" width="40%" align="right">
                                        <div style="display: none">
                                            <dx:ASPxTextBox ID="txtBh" ClientInstanceName="txtBh" runat="server" Width="170px">
                                            </dx:ASPxTextBox>
                                        </div>
                                        公告标题：
                                    </td>
                                    <td>
                                        <dx:ASPxTextBox ID="txtGgbtx" ClientInstanceName="ggbt" runat="server" Width="170px"
                                            CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                        </dx:ASPxTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" width="40%" align="right">
                                        公告内容：
                                    </td>
                                    <td>
                                        <dx:ASPxMemo ID="txtGgnrx" ClientInstanceName="ggnr" runat="server" Height="140px"
                                            Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                        </dx:ASPxMemo>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" width="40%" align="right">
                                        发布人：
                                    </td>
                                    <td>
                                        <dx:ASPxTextBox ID="txtFbrx" ClientInstanceName="fbr" runat="server" Width="170px"
                                            CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                        </dx:ASPxTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" width="40%" align="right">
                                        发布时间：
                                    </td>
                                    <td>
                                        <%--<dx:ASPxDateEdit ID="deFbsjx" ClientInstanceName="fbsj" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                            <CalendarProperties>
                                                <HeaderStyle Spacing="1px" />
                                            </CalendarProperties>
                                        </dx:ASPxDateEdit>--%>
                                        <dx:ASPxTextBox ID="txtFbsjx" ReadOnly="true" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                        </dx:ASPxTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <dx:ASPxButton ID="btnXg" runat="server" Text="修改" Width="60px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                            OnClick="btnXg_Click">
                                            <ClientSideEvents Click="function(s, e) { pcUpdateNotice.Hide(); }" />
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="btnQx" runat="server" Text="取消" Width="60px" Style="height: 25px"
                                            CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                            <ClientSideEvents Click="function(s, e) { pcUpdateNotice.Hide(); }" />
                                        </dx:ASPxButton>
                                    </td>
                                </tr>
                            </table>
                        </dx:PanelContent>
                    </PanelCollection>
                </dx:ASPxPanel>
            </dx:PopupControlContentControl>
        </ContentCollection>
    </dx:ASPxPopupControl>
    <asp:LinqDataSource ID="LDSXjgg" runat="server" ContextTypeName="DAL.DataClassesDataContext"
        TableName="Xjgg" Where="xjbh == @xjbh">
        <WhereParameters>
            <asp:QueryStringParameter Name="xjbh" QueryStringField="SID" Type="String" />
        </WhereParameters>
    </asp:LinqDataSource>
</asp:Content>
